Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tan De Jun] iP #49

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open

[Tan De Jun] iP #49

wants to merge 46 commits into from

Conversation

dejunnn
Copy link

@dejunnn dejunnn commented Jan 31, 2020

No description provided.

@dejunnn dejunnn changed the title [Tan De Jun] [Tan De Jun] iP Jan 31, 2020
@dejunnn dejunnn requested a review from damithc January 31, 2020 04:28
@damithc damithc removed their request for review February 4, 2020 01:06

System.out.println("____________________________________________________________");

if (input.equals("list")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better as a constant instead of a magic string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would. Must have overlooked it thanks for pointing it out! :)

String input = sc.nextLine();
String[] inputArray = input.split(" ", 2);

System.out.println("____________________________________________________________");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to put this in a method (for example displayLine()) instead of a magic string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a great idea. Will implement it into my code 👍

public class Duke {
public static void main(String[] args) {
welcomeMessage();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think printWelcomeMessage() would be a better name than welcomeMessage() as it is a verb

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you are right. It would be clearer to the user as well. Thanks!


Scanner sc = new Scanner(System.in);
List<Task> tasks = new ArrayList<Task>();
Boolean exitProgram = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to be called isExitCommandUsed instead of exitProgram as a boolean variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants